import {login , getCaptcha} from "@/api/login";

const state = {
    token: '' ,
}

const mutations = {
    setToken: (state , token) =>{
        state.token = token;
    },
}

const actions = {
    async Login({commit} , userInfo){
        const {username , password , code , uuid} = userInfo;
        const res = await login(username , password , code , uuid);
        const {token} = res;
        commit('setToken' , token);
    },

}

export default {
    namespaced: true,
    state,
    mutations,
    actions
}
